package com.vonchenchen.mytest.PhotoRoll;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

import com.vonchenchen.mytest.R;

/**
 * Created by Administrator on 2015/10/28 0028.
 */
public class PhotoActivity extends Activity {

    private ImageView mImageView;
    private Bitmap mBitmap;
    private View mRootView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_photoroll);

        mImageView = (ImageView) findViewById(R.id.iv_photo);
        mRootView = findViewById(R.id.ll_root);
        mImageView.setImageResource(R.mipmap.ic_launcher);

        mBitmap = BitmapFactory.decodeResource(getResources(),R.mipmap.ic_launcher);

        mImageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                PhotoRollPopWindow photoRollPopWindow = new PhotoRollPopWindow(PhotoActivity.this, mBitmap);
                photoRollPopWindow.show(mRootView);
            }
        });
    }
}
